package com.play2gether;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.TextView;

public class ImageAdapter extends BaseAdapter {
    private Context mContext;

    public ImageAdapter(Context c) {
        mContext = c;
    }

    public int getCount() {
        return mThumbIds.length;
    }

    public Object getItem(int position) {
        return null;
    }

    public long getItemId(int position) {
        return 0;
    }

    // create a new ImageView for each item referenced by the Adapter
    public View getView(int position, View convertView, ViewGroup parent) {
        ImageView imageView;
        TextView texto;
        if (convertView == null) {  // if it's not recycled, initialize some attributes
            imageView = new ImageView(mContext);
            imageView.setLayoutParams(new GridView.LayoutParams(300, 300));
            imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
            imageView.setPadding(8, 8, 8, 8);

        } else {
            imageView = (ImageView) convertView;
        }

        imageView.setImageResource(mThumbIds[position]);
        return imageView;
    }

    // references to our images
    private Integer[] mThumbIds = {
            R.drawable.misionero,
            R.drawable.hamaca,
            R.drawable.sometido,
            R.drawable.abrazo_total,
            R.drawable.ofendra,
            R.drawable.molde,
            R.drawable.catalana,
            R.drawable.catapulta,
            R.drawable.medusa,
            R.drawable.provocadora,
            R.drawable.atrapado,
            R.drawable.carretilla,
            R.drawable.sorpresa,
            R.drawable.somnolienta,
            R.drawable.arana,
            R.drawable.muelle,
            R.drawable.aspas,
            R.drawable.abrazo,
            R.drawable.abierto,
            R.drawable.profunda,
            R.drawable.arco,
            R.drawable.cara,
            R.drawable.explosiva,
            R.drawable.amazona,
            R.drawable.balsa,
            R.drawable.lapa,
            R.drawable.furor,
            R.drawable.posesion,
            R.drawable.cangrejo,
            R.drawable.mochila,
            R.drawable.boa,
            R.drawable.doma,
            R.drawable.tijera,
            R.drawable.butaca,
            R.drawable.fusion,
            R.drawable.libelula,
            R.drawable.tornillo,
            R.drawable.espejo,
            R.drawable.extasis,
            R.drawable.trapecio,

    };
/*
    private Integer[] mThumbIds = {
            R.drawable.misionero,
            R.drawable.hamaca,
            R.drawable.sometido,
            R.drawable.abrazo_total,
            R.drawable.ofendra,
            R.drawable.molde,
            R.drawable.catalana,
            R.drawable.catapulta,
            R.drawable.medusa,
            R.drawable.provocadora
    };
    */
}
